<template>
  <div>
    <el-table :data="tableData2" style="width: 100%" :row-class-name="tableRowClassName">
      <el-table-column prop="goods_id" label="日期" width="180"></el-table-column>
      <el-table-column prop="goods_name" label="姓名" width="180"></el-table-column>
      <el-table-column prop="goods_type" label="地址"></el-table-column>
      <el-table-column prop="store_count" label="地址"></el-table-column>
      <el-table-column prop="is_show" label="地址"></el-table-column>
      <el-table-column prop="is_hot" label="地址"></el-table-column>
    </el-table>
    <el-pagination
      background
      layout="prev, pager, next"
      :total="total"
      :page-size="8"
      @current-change="nowpage"
      >
    </el-pagination>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData2: [],
      page: 1,
      total: 1
    };
  },
  created() {
    this.list();
  },
  methods: {
    nowpage(page) {
      var _self = this;
      _self.page = page;
      _self.list();
    },
    list: function() {
      var _self = this;
      _self.$ajax.get('http://127.0.0.1/tp/mk_1/tp666/public/index.php/month', {
          params: {
            page: _self.page
          }
        })
        .then(function(response) {
          console.log(response);
          _self.tableData2 = response.data.data.data;
          _self.total = response.data.data.total;
        })
        .catch(function(error) {
          console.log(error);
        });
    }
  }
};
</script>

<style>
.el-table .warning-row {
  background: oldlace;
}

.el-table .success-row {
  background: #f0f9eb;
}
</style>
